import test from "@/uni_modules/uview-plus/libs/function/test";
const base = {
  mapKey: "IIOBZ-WKNLV-PPPP7-57OSU-URGBF-N4FGF", // 客户端地图key
  workerMapKey: "TSRBZ-3E4LB-TU3U2-NDPDM-53NX6-EAFCK", // 阿姨端地图key
  appid: "ttbf91c92c209bde2501", // 正式
  // appid: "ttfb978d2a649e07ca01", // 沙盒
  pluginid: "tta5a3d31e3aecfb9b11",
  MainColor: "#00adad",
  // 默认经纬度 哈尔滨市政府
  dfLatLng: {
    lat: 45.802981, // 纬度
    lng: 126.53505, // 经度
  },
  // 默认citycode哈尔滨
  dfCityCode: {
    code: "2301",
    name: "哈尔滨市",
  },
  // // 默认经纬度 北京天安门
  // dfLatLng: {
  //   lat: 39.916351, // 纬度
  //   lng: 116.397041, // 经度
  // },
  // // 默认citycode北京
  // dfCityCode: {
  //   code: "1101",
  //   name: "北京市",
  // },
  toast(param) {
    param = param || {};
    const {
      msg = param,
      time = 1500,
      icon = "none",
      position = "center",
      mask = true,
      success,
      fail,
      complete,
    } = param;
    const type = typeof msg;
    const title = ["string", "number"].includes(type)
      ? msg.toString()
      : "[请联系管理员]";
    uni.showToast({
      duration: time,
      icon: test.empty(icon) ? "none" : icon,
      mask: true,
      title,
      position,
      success,
      fail,
      complete,
    });
  },
  loadToast(msg) {
    uni.showLoading({
      title: test.empty(msg) ? "加载中..." : msg,
      mask: true,
    });
  },
  loadHide(time = 100) {
    setTimeout(() => {
      uni.hideLoading();
    }, time);
  },
};

export default base;
